﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="DsChiTietCongNoKetHop" targetNamespace="http://tempuri.org/DsChiTietCongNoKetHop.xsd" xmlns:mstns="http://tempuri.org/DsChiTietCongNoKetHop.xsd" xmlns="http://tempuri.org/DsChiTietCongNoKetHop.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="E_SmarketConnectionStringSrmServer" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="E_SmarketConnectionStringSrmServer (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.ReportGenerators.Properties.Settings.GlobalReference.Default.E_SmarketConnectionStringSrmServer" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="Detail_ChiTietCongNoKetHopTableAdapter" GeneratorDataComponentClassName="Detail_ChiTietCongNoKetHopTableAdapter" Name="Detail_ChiTietCongNoKetHop" UserDataComponentName="Detail_ChiTietCongNoKetHopTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="E_SmarketConnectionStringSrmServer (Settings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SElECT A.Ngay, C.So SoChungTu, D.Ten LoaiChungTu, C.DienGiai, SUM(A.GiaTri) TangPhaiThu, CAST(0 AS money) GiamPhaiThu, CAST(0 AS money) DuPhaiThu,
									CAST(0 AS money) TangPhaiTra, CAST(0 AS money) GiamPhaiTra, CAST(0 AS money) DuPhaiTra,
									CAST(0 AS money) Du									
FROM ButToan A INNER JOIN TaiKhoan B ON A.TaiKhoanNoID = B.ID AND B.SoHieu LIKE '131'
				INNER JOIN ChungTu C ON A.ChungTuID = C.ChungTuID
				INNER JOIN LoaiChungTu D ON C.LoaiChungTuID = D.ID
GROUP BY A.Ngay, C.So, C.DienGiai, D.Ten			
UNION
SElECT A.Ngay, C.So SoChungTu,  D.Ten LoaiChungTu, C.DienGiai, CAST(0 AS money) TangPhaiThu, SUM(A.GiaTri) GiamPhaiThu, CAST(0 AS money) DuPhaiThu,
									CAST(0 AS money) TangPhaiTra, CAST(0 AS money) GiamPhaiTra, CAST(0 AS money) DuPhaiTra,
									CAST(0 AS money) Du
FROM ButToan A INNER JOIN TaiKhoan B ON A.TaiKhoanCoID = B.ID AND B.SoHieu LIKE '131'
				INNER JOIN ChungTu C ON A.ChungTuID = C.ChungTuID
				INNER JOIN LoaiChungTu D ON C.LoaiChungTuID = D.ID
GROUP BY A.Ngay, C.So, C.DienGiai, D.Ten
UNION
SElECT A.Ngay, C.So SoChungTu,  D.Ten LoaiChungTu,C.DienGiai, CAST(0 AS money) TangPhaiThu, CAST(0 AS money) GiamPhaiThu, CAST(0 AS money) DuPhaiThu,
									SUM(A.GiaTri) TangPhaiTra, CAST(0 AS money) GiamPhaiTra, CAST(0 AS money) DuPhaiTra,
									CAST(0 AS money) Du
FROM ButToan A INNER JOIN TaiKhoan B ON A.TaiKhoanCoID = B.ID AND B.SoHieu LIKE '331'
				INNER JOIN ChungTu C ON A.ChungTuID = C.ChungTuID
				INNER JOIN LoaiChungTu D ON C.LoaiChungTuID = D.ID
GROUP BY A.Ngay, C.So, C.DienGiai, D.Ten
UNION
SElECT A.Ngay, C.So SoChungTu,  D.Ten LoaiChungTu, C.DienGiai, CAST(0 AS money) TangPhaiThu, CAST(0 AS money)  GiamPhaiThu, CAST(0 AS money) DuPhaiThu,
									CAST(0 AS money) TangPhaiTra, SUM(A.GiaTri) GiamPhaiTra, CAST(0 AS money) DuPhaiTra,
									CAST(0 AS money) Du
FROM ButToan A INNER JOIN TaiKhoan B ON A.TaiKhoanNoID = B.ID AND B.SoHieu LIKE '331'
				INNER JOIN ChungTu C ON A.ChungTuID = C.ChungTuID
				INNER JOIN LoaiChungTu D ON C.LoaiChungTuID = D.ID
GROUP BY A.Ngay, C.So, C.DienGiai, D.Ten
		</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Ngay" DataSetColumn="Ngay" />
              <Mapping SourceColumn="SoChungTu" DataSetColumn="SoChungTu" />
              <Mapping SourceColumn="LoaiChungTu" DataSetColumn="LoaiChungTu" />
              <Mapping SourceColumn="DienGiai" DataSetColumn="DienGiai" />
              <Mapping SourceColumn="TangPhaiThu" DataSetColumn="TangPhaiThu" />
              <Mapping SourceColumn="GiamPhaiThu" DataSetColumn="GiamPhaiThu" />
              <Mapping SourceColumn="DuPhaiThu" DataSetColumn="DuPhaiThu" />
              <Mapping SourceColumn="TangPhaiTra" DataSetColumn="TangPhaiTra" />
              <Mapping SourceColumn="GiamPhaiTra" DataSetColumn="GiamPhaiTra" />
              <Mapping SourceColumn="DuPhaiTra" DataSetColumn="DuPhaiTra" />
              <Mapping SourceColumn="Du" DataSetColumn="Du" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="DsChiTietCongNoKetHop" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="DsChiTietCongNoKetHop" msprop:Generator_DataSetName="DsChiTietCongNoKetHop" msprop:EnableTableAdapterManager="true">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="Detail_ChiTietCongNoKetHop" msprop:Generator_UserTableName="Detail_ChiTietCongNoKetHop" msprop:Generator_RowDeletedName="Detail_ChiTietCongNoKetHopRowDeleted" msprop:Generator_RowChangedName="Detail_ChiTietCongNoKetHopRowChanged" msprop:Generator_RowClassName="Detail_ChiTietCongNoKetHopRow" msprop:Generator_RowChangingName="Detail_ChiTietCongNoKetHopRowChanging" msprop:Generator_RowEvArgName="Detail_ChiTietCongNoKetHopRowChangeEvent" msprop:Generator_RowEvHandlerName="Detail_ChiTietCongNoKetHopRowChangeEventHandler" msprop:Generator_TableClassName="Detail_ChiTietCongNoKetHopDataTable" msprop:Generator_TableVarName="tableDetail_ChiTietCongNoKetHop" msprop:Generator_RowDeletingName="Detail_ChiTietCongNoKetHopRowDeleting" msprop:Generator_TablePropName="Detail_ChiTietCongNoKetHop">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Ngay" msprop:Generator_UserColumnName="Ngay" msprop:Generator_ColumnVarNameInTable="columnNgay" msprop:Generator_ColumnPropNameInRow="Ngay" msprop:Generator_ColumnPropNameInTable="NgayColumn" type="xs:dateTime" minOccurs="0" />
              <xs:element name="SoChungTu" msprop:Generator_UserColumnName="SoChungTu" msprop:Generator_ColumnVarNameInTable="columnSoChungTu" msprop:Generator_ColumnPropNameInRow="SoChungTu" msprop:Generator_ColumnPropNameInTable="SoChungTuColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="LoaiChungTu" msprop:Generator_UserColumnName="LoaiChungTu" msprop:Generator_ColumnVarNameInTable="columnLoaiChungTu" msprop:Generator_ColumnPropNameInRow="LoaiChungTu" msprop:Generator_ColumnPropNameInTable="LoaiChungTuColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="DienGiai" msprop:Generator_UserColumnName="DienGiai" msprop:Generator_ColumnVarNameInTable="columnDienGiai" msprop:Generator_ColumnPropNameInRow="DienGiai" msprop:Generator_ColumnPropNameInTable="DienGiaiColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="200" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="TangPhaiThu" msprop:Generator_UserColumnName="TangPhaiThu" msprop:Generator_ColumnVarNameInTable="columnTangPhaiThu" msprop:Generator_ColumnPropNameInRow="TangPhaiThu" msprop:Generator_ColumnPropNameInTable="TangPhaiThuColumn" type="xs:decimal" minOccurs="0" />
              <xs:element name="GiamPhaiThu" msprop:Generator_UserColumnName="GiamPhaiThu" msprop:Generator_ColumnVarNameInTable="columnGiamPhaiThu" msprop:Generator_ColumnPropNameInRow="GiamPhaiThu" msprop:Generator_ColumnPropNameInTable="GiamPhaiThuColumn" type="xs:decimal" minOccurs="0" />
              <xs:element name="DuPhaiThu" msprop:Generator_UserColumnName="DuPhaiThu" msprop:Generator_ColumnVarNameInTable="columnDuPhaiThu" msprop:Generator_ColumnPropNameInRow="DuPhaiThu" msprop:Generator_ColumnPropNameInTable="DuPhaiThuColumn" type="xs:decimal" minOccurs="0" />
              <xs:element name="TangPhaiTra" msprop:Generator_UserColumnName="TangPhaiTra" msprop:Generator_ColumnVarNameInTable="columnTangPhaiTra" msprop:Generator_ColumnPropNameInRow="TangPhaiTra" msprop:Generator_ColumnPropNameInTable="TangPhaiTraColumn" type="xs:decimal" minOccurs="0" />
              <xs:element name="GiamPhaiTra" msprop:Generator_UserColumnName="GiamPhaiTra" msprop:Generator_ColumnVarNameInTable="columnGiamPhaiTra" msprop:Generator_ColumnPropNameInRow="GiamPhaiTra" msprop:Generator_ColumnPropNameInTable="GiamPhaiTraColumn" type="xs:decimal" minOccurs="0" />
              <xs:element name="DuPhaiTra" msprop:Generator_UserColumnName="DuPhaiTra" msprop:Generator_ColumnVarNameInTable="columnDuPhaiTra" msprop:Generator_ColumnPropNameInRow="DuPhaiTra" msprop:Generator_ColumnPropNameInTable="DuPhaiTraColumn" type="xs:decimal" minOccurs="0" />
              <xs:element name="Du" msprop:Generator_UserColumnName="Du" msprop:Generator_ColumnVarNameInTable="columnDu" msprop:Generator_ColumnPropNameInRow="Du" msprop:Generator_ColumnPropNameInTable="DuColumn" type="xs:decimal" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>